import {
	Api
} from '@/common/api'
import {
	ApiBase
} from '@/common/api-base.js';

import upload from '@/common/upload'


class UserClass extends ApiBase {
	updateUserPwd(oldPassword, newPassword) {
		return Api.put(`${this._namespace}/profile/updatePwd`, {
			oldPassword,
			newPassword
		});
	}
	getUserProfile() {
		return Api.get(`${this._namespace}/profile`, );
	}
	updateUserProfile(params) {
		return Api.put(`${this._namespace}/profile`, params);
	}
	getCodeImg() {
		return Api.get(`${this._namespace}/captchaImage`, {
			isToken: false,
			timeout: 20000
		});
	}
	uploadAvatar(data) {
		return upload({
			url: '/system/user/profile/avatar',
			name: data.name,
			filePath: data.filePath
		})
	}
    getExpert(hospitalId){
        return Api.get(`${this._namespace}/get/mini/program/doctor/${hospitalId}`, );
    }
    getUser(userId){
        return Api.get(`${this._namespace}/${userId}`, );
    }
    userManageUploadAvatar(data){
        return upload({
        	url: '/system/user/profile/avatar/userManagementUpload',
        	name: data.name,
        	file: data.file
        })
    }
    updateUser(data){
        return Api.put(`${this._namespace}`,data );
    }
    getConsolutionExpert(hospitalId){
        return Api.get(`${this._namespace}/get/consultation/doctor/${hospitalId}`, );
    }
	 // 获取我的医生
	getMyDoctor(patientId){
	    return Api.get(`${this._namespace}/get/user/doctor/list/${patientId}`, );
	}
    
    
    

}

export const UserApi = new UserClass('/system/user')
